package com.app.provider;

import android.content.Context;
import android.support.v4.view.ActionProvider;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;

import com.app.R;

/**
 * Created by Administrator on 2016/11/4.
 */

public class ChangeMenuProvider extends ActionProvider {


    private Context mContext;

    private View view;


    /**
     * Creates a new instance.
     *
     * @param context Context for accessing resources.
     */
    public ChangeMenuProvider(Context context) {
        super(context);
        mContext = context;
    }

    @Override
    public View onCreateActionView() {
        view = LayoutInflater.from(mContext).inflate(R.layout.menu_common_layout, null);
        ((TextView)view.findViewById(R.id.tvTitle)).setText("更改");
        return view;
    }


    public void setOnClickListener(View.OnClickListener onClickListener) {
        if (null != view) {
            view.setOnClickListener(onClickListener);
        }
    }



}
